<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<html>
<head>
    <meta charset="UTF-8">
    <title>充值规则</title>
    <script src="${pageContext.request.contextPath}/static/js/jquery-3.4.1.min.js"></script>
    <script src="${pageContext.request.contextPath}/static/js/bootstrap.min.js"></script>
    <script src="${pageContext.request.contextPath}/static/toastr/toastr.min.js"></script>
    <script src="${pageContext.request.contextPath}/static/js/Myjs.js"></script>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/bootstrap.min.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/toastr/toastr.min.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/top_up_rule/css/vip_list.css">
    <style>
        .sp {
            position: absolute;
            margin-left: 30%;
            color: #ff0000;
            font-size: 1px;
            top: 33px;
            left: 31px;
            width: 110px;
            display: none;
        }
    </style>
</head>
<body>
<!-- 新增 充值规则模态框-->
<div class="modal fade" id="myModal1" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    &times;
                </button>
                <h4 class="modal-title" id="myModalLabel1">
                    充值规则
                </h4>
            </div>
            <form id="rechargerule">
            <div class="modal-body">
                <form id="ruleForm" >
                    <div class="row">
                        <div class="col-md-12">
                            <div class="form-group input-group" id="d1">
                                <span class="input-group-addon">充值规则</span>
                                <input class="form-control" placeholder="充值规则" name="name" id="name">
                            </div>
                        </div>
                    </div>

                    <div class="row">
                        <div class="col-md-4">
                            <div class="form-group input-group" id="d2">
                                <span class="input-group-addon">充值系数</span>
                                <input class="form-control" placeholder="充值系数" name="coefficient" id="coefficient"
                                       onkeyup="this.value=this.value.replace(/[^\d^\.]+/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.').replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')">

                            </div>
                        </div>
                        <div class="col-md-4">
                            <div class="form-group input-group" id="d3">
                                <span class="input-group-addon">起充金额</span>
                                <input class="form-control" placeholder="起充金额" name="startMoney" id="startMoney"
                                       onkeyup="this.value=this.value.replace(/[^\d^\.]+/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.').replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')">
                            </div>
                        </div>
                        <div class="col-md-4">
                            <div class="form-group input-group">
                                <span class="input-group-addon">状态</span>
                                <select class="form-control" id="status" name="status">
                                    <option value="1">启用</option>
                                    <option value="0">禁用</option>
                                </select>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-6">
                            <div class="form-group input-group">
                                <span class="input-group-addon">创建时间</span>
                                <input  type="text" class="form-control" placeholder="创建时间" name="createdTime" id="createdTime" disabled>
                            </div>
                        </div>
                        <div class="col-md-6">
                            <div class="form-group input-group" id="d4">
                                <span class="input-group-addon">结束时间</span>
                                <input  type="date" class="form-control" placeholder="结束时间" name="endTime" id="endTime">

                            </div>
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">
                    关闭
                </button>
                <button type="button" class="btn btn-primary" id="btn1" onclick="btn()">
                    确认
                </button>
            </div>
            </form>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>
<div>
    <!--  新增充值规则模态框-->
    <!--  修改规则模态框-->
    <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                        &times;
                    </button>
                    <h4 class="modal-title" id="myModalLabel">
                        充值规则
                    </h4>
                </div>
                <form id="rechargerule1">
                <div class="modal-body">
                    <form id="ruleForm1">
                        <div class="row">
                            <div class="col-md-4" hidden>
                                <div class="form-group input-group">
                                    <span class="input-group-addon">编号</span>
                                    <input class="form-control" placeholder="编号" name="id" id="id1">
                                    <input name="rechargeruleId" id="rechargeruleId">
                                </div>
                            </div>
                            <div class="col-md-12">
                                <div class="form-group input-group" id="dd1">
                                    <span class="input-group-addon">充值规则</span>
                                    <input class="form-control" placeholder="充值规则" name="name" id="name1">
                                </div>
                            </div>
                        </div>

                        <div class="row">
                            <div class="col-md-4">
                                <div class="form-group input-group" id="dd2">
                                    <span class="input-group-addon">充值系数</span>
                                    <input class="form-control" placeholder="充值系数" name="coefficient" id="coefficient1"
                                           onkeyup="this.value=this.value.replace(/[^\d^\.]+/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.').replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')">

                                </div>
                            </div>
                            <div class="col-md-4">
                                <div class="form-group input-group" id="dd3">
                                    <span class="input-group-addon">起充金额</span>
                                    <input class="form-control" placeholder="起充金额" name="startMoney" id="startMoney1"
                                           onkeyup="this.value=this.value.replace(/[^\d^\.]+/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.').replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')">
                                </div>
                            </div>
                            <div class="col-md-4">
                                <div class="form-group input-group">
                                    <span class="input-group-addon">状态</span>
                                    <select class="form-control" name="status" id="status1">
                                        <option value="1">启用</option>
                                        <option value="0">禁用</option>
                                    </select>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-6">
                                <div class="form-group input-group">
                                    <span class="input-group-addon">创建时间</span>
                                    <input class="form-control" placeholder="创建时间" readonly="readonly"
                                           name="createdTime" id="createdTime11">
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="form-group input-group" id="dd4">
                                    <span class="input-group-addon">结束时间</span>
                                    <input class="form-control" type="date" placeholder="结束时间" name="endTime" id="endTime1">


                                </div>
                            </div>
                        </div>
                    </form>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">
                        关闭
                    </button>
                    <button type="button" class="btn btn-primary" id="confirm" onclick="btn1()">
                        确认
                    </button>
                </div>
                </form>
            </div><!-- /.modal-content -->
        </div><!-- /.modal -->
    </div>
    <!--  修改规则模态框-->
    <!-- 删除提示 -->
    <div>
        <div class="modal fade bs-example-modal-sm" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel">
            <div class="modal-dialog modal-sm" role="document">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                                aria-hidden="true">&times;</span></button>
                        <h5 class="modal-title">操作提示</h5>
                    </div>
                    <form action="/rechargeruleServlet/delete">
                        <div class="modal-body">
                            确认当前操作
                            <input hidden id="id" name="id">
                        </div>
                        <div id="opinfo" class=" modal-footer">
                            <button type="submit" class="confirm btn btn-primary btn-success btn-sm">确认</button>
                            <button type="button" class="btn btn-default btn-sm" data-dismiss="modal">取消</button>
                        </div>
                    </form>

                </div>
            </div>
        </div>
    </div>
    <!-- 删除提示 -->
    <div>
        <div style="padding:20px;">
            <form role="form" class="form-inline">
                <div class="form-group">
                    <label>充值规则</label>
                    <input type="text" class="form-control" placeholder="充值规则" id="ruleName"/>
                </div>
                <button type="button" class="btn btn-primary btn-sm " onclick="page(1,5)">搜索</button>
                <button type="button" class="btn btn-primary btn-sm" onclick="add()">新增充值规则</button>
            </form>
        </div>


        <table class="table table-hover table-bordered" style="text-align: center">
            <thead>
            <tr style="background-color: #BBDCFB">
                <th>排序</th>
                <th>充值规则</th>
                <th>公告状态</th>
                <th>充值系数</th>
                <th>起充金额</th>
                <th>创建日期</th>
                <th>结束日期</th>
                <th>操作</th>
            </tr>
            </thead>

            <tbody id="tb"></tbody>

        </table>
        <div class="form-inline">
                <span id="navBar">显示第<span id="start"></span>到<span id="end"></span>条，总共<span id="count"></span>页记录，每页显示
                <div class="btn-group dropup">
                    <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"><span id="pageCount"></span>&nbsp;&nbsp;<span class="caret"></span></button>
                    <ul class="dropdown-menu" role="menu">
                        <li><a href="javascript:page(1,5)">5</a></li>
                        <li><a href="javascript:page(1,10)">10</a></li>
                        <li><a href="javascript:page(1,50)">50</a></li>
                        <li><a href="javascript:page(1,100)">100</a></li>
                    </ul>
                </div>
				条记录</span>
            <div class="btn-group pull-right">
                <nav  aria-label="Page navigation" >
                    <ul class="pagination" id="page" style="margin: 0px 0">
                    </ul>
                </nav>
            </div>
        </div>
    </div>

</div>
<%--  js--%>
<script src="${pageContext.request.contextPath}/top_up_rule/js/top_up_rules.js"></script>

</body>

</html>
